package com.ruoyi.cust.service.impl;

import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cust.mapper.CityInfoMapper;
import com.ruoyi.cust.domain.CityInfo;
import com.ruoyi.cust.service.ICityInfoService;

/**
 * 资讯Service业务层处理
 *
 * @author cjq
 * @date 2024-12-06
 */
@Service
public class CityInfoServiceImpl implements ICityInfoService {
    @Autowired
    private CityInfoMapper cityInfoMapper;

    /**
     * 查询资讯
     *
     * @param infoId 资讯主键
     * @return 资讯
     */
    @Override
    public CityInfo selectCityInfoByInfoId(Long infoId) {
        return cityInfoMapper.selectCityInfoByInfoId(infoId);
    }

    /**
     * 查询资讯列表
     *
     * @param cityInfo 资讯
     * @return 资讯
     */
    @Override
    public List<CityInfo> selectCityInfoList(CityInfo cityInfo) {
        return cityInfoMapper.selectCityInfoList(cityInfo);
    }

    /**
     * 新增资讯
     *
     * @param cityInfo 资讯
     * @return 结果
     */
    @Override
    public int insertCityInfo(CityInfo cityInfo) {
                cityInfo.setCreateTime(DateUtils.getNowDate());
            return cityInfoMapper.insertCityInfo(cityInfo);
    }

    /**
     * 修改资讯
     *
     * @param cityInfo 资讯
     * @return 结果
     */
    @Override
    public int updateCityInfo(CityInfo cityInfo) {
        return cityInfoMapper.updateCityInfo(cityInfo);
    }

    /**
     * 批量删除资讯
     *
     * @param infoIds 需要删除的资讯主键
     * @return 结果
     */
    @Override
    public int deleteCityInfoByInfoIds(Long[] infoIds) {
        return cityInfoMapper.deleteCityInfoByInfoIds(infoIds);
    }

    /**
     * 删除资讯信息
     *
     * @param infoId 资讯主键
     * @return 结果
     */
    @Override
    public int deleteCityInfoByInfoId(Long infoId) {
        return cityInfoMapper.deleteCityInfoByInfoId(infoId);
    }
}
